<template>
  <div class="sydjzxDetail con-layout">
    <my-bread title="失业登记注销查询" :goback="true"></my-bread>
    <div class="sydezxDetail-content">
      <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
      <div class="list-item" v-for="item in list" :key="item.sydjid">
        <div class="list-top">
          <div class="top-name">
            <span class="name">办理时间：{{item.czsj}}</span>
            <span class="bl" :class="{'red':item.bljg!= '1'}">{{item.bljg == ''?'办理中': item.bljg== '0' ? '办理失败' : '办理成功'}}</span>
          </div>
          <div class="top-item" v-if="item.sbyy">
            <span>注销失败原因：</span>
            <p>{{item.sbyy}}</p>
          </div>
          <div class="top-item"  v-if="item.zxyymc">
            <span>失业登记注销原因：</span>
            <p>{{item.zxyymc}}</p>
          </div>
        </div>
        <div class="list-bottom"  v-if="item.zxyy == '0070'">
          <div class="bottom-item">
            <span>裁决书编号：</span>
            <p>{{item.cjsbh}}</p>
          </div>
          <div class="bottom-item">
            <span>裁决日期：</span>
            <p>{{item.czsj}}</p>
          </div>
          <div class="bottom-item">
            <span>裁决书内容：</span>
            <p>{{item.cjsnr}}</p>
          </div>
        </div>
      </div>
      </van-list>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      pageNum: 1,
      pageSize: 10,
      loading: false,
      finished: false
    };
  },
  methods: {
    onLoad(){
      this.$http({
        url:'/jysydj/sydjzx/sydjzxlsjlCx',
        method:'get',
        params:{
          pagenum: this.pageNum,
          pagesize: this.pageSize
        }
      }).then(res=>{
       // 加载状态结束
        this.loading = false;
        this.finished = false;
        let data = res.returnData;
        if (+data.executeResult == 1) {
          this.pageNum++;
          if (data.zxlb) {
            this.list.push(...data.zxlb);
          }
          if (this.pageNum > res.pageCount) {
            this.finished = true;
            // 数据加载完毕
          }
        } else {
          this.sildeShow = false;
          this.finished = true;
          return false;
        }
      })
    }
  }
};
</script>

<style lang="scss" scoped>
.sydezxDetail-content {
  padding: 33px;
  box-sizing: border-box;
  .list-item {
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0px 3px 13px 0px rgba(8, 8, 61, 0.1);
    padding: 33px 33px 27px 33px;
    margin-top: 21px;
    box-sizing: border-box;
    .list-top {
      border-bottom: 1px dashed #dbdbdb;
      .top-name {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 33px;
        .bl {
          font-size: 28px;
          font-weight: 500;
          color: #06a8f6;
          letter-spacing: 1px;
        }
        .yellow {
          color: #ff9800;
        }
        .red {
          color: #f44336;
        }
      }
      .top-item {
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        font-size: 25px;
        color: #333333;
        margin-bottom: 21px;
        span {
          width: 0 0 auto;
        }
        p {
          flex: 1;
          color: #333333;
          font-size: 25px;
          line-height: 35px;
        }
      }
    }
    .list-bottom {
      margin-top: 19px;
      .bottom-item {
        font-size: 25px;
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        span {
          width: 0 0 auto;
        }
        p {
          flex: 1;
          color: #333333;
          font-size: 25px;
          line-height: 35px;
        }
      }
    }
  }
}
</style>
